package com.jk.dmconsumer.controller;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipayTradeRefundRequest;
import com.jk.dmconsumer.config.AlipayConfig;
import com.jk.dmconsumer.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.UUID;

/**
 * 文件名称:RefundController
 *
 * @Description //TODO $
 * @Date $ $
 * 作者 郭英杰
 * Copyright (c) 2021, yuxy123@gmail.com All Rights Reserved.</pre>
 */
@RestController
@RequestMapping("refundOrder")
public class RefundController {

    @Autowired
    private OrderService orderService;

    //退款
    @RequestMapping("refund")
    public void toRefund(HttpServletResponse response, HttpSession session) throws IOException, AlipayApiException {
        orderService.refund(response,session);
    }


}
